import { ref, } from 'vue'
import { defineStore } from 'pinia'
import { getCategoryAPI } from '@/apis/layout'
export const useCategoryStore = defineStore('category', () => {
    //!当前导航列表的逻辑

    //！state 导航列表数据
    const categoryList = ref([])
    //!action 导航列表方法
    const getCategory = async () => {
        let result = await getCategoryAPI()
        if (result.code == 1) {
            categoryList.value = result.result
        }
    }

    return { categoryList, getCategory }
})
